﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MindFactorial.LaunchPoint.Common
{
    /// <summary>
    /// Represents a an object passed around as data
    /// </summary>
    public abstract class CommonDataObject : IDataEntity
    {
        /// <summary>
        /// serializes the entity
        /// </summary>
        /// <returns></returns>
        public abstract Xml Serialize();

        /// <summary>
        /// deserializes the entity
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="entitydata"></param>
        /// <returns></returns>
        public abstract T Deserialize<T>(Xml entitydata) where T : CommonDataObject;

        /// <summary>
        /// locks the entity
        /// </summary>
        /// <returns></returns>
        public abstract bool Lock();

        /// <summary>
        /// unlocks the entity
        /// </summary>
        /// <returns></returns>
        public abstract bool Unlock();
    }
}
